home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / netz / pgp / contrib / md5sum / md5sum.doc < prev    next >
Text File  |  1993-09-18  |  8KB  |  207 lines

  1.        MD5SUM - amiga port by Peter Simons <simons@peti.GUN.de>
  2.  
  3.                  Manual edition 1 (18 September 1993)
  4.  
  5. Disclaimer
  6. ==========
  7.  
  8.     MD5SUM has been written by Branko Lankester and Colin Plumb and has
  9. been modified by me to compile with SAS/C on the Amiga. The complete
  10. source and an smakefile are included in the distribution. This utility
  11. is public domain.
  12.  
  13.     This program is distributed in the hope that it will be useful, but
  14. WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  16.  
  17. What is MD5SUM?
  18. ===============
  19.  
  20.     MD5SUM is a small utility that allows you to build checksums over
  21. text- or binary files, using the "MD5 Message Digest Algorithm".  (1)
  22. These checksums can be stored in a file and can be validated later,
  23. using MD5SUM.
  24.  
  25. For example, the checksums of the MD5SUM sources look like this:
  26.  
  27.      107788ec46ef6ab9dbb190215f5b6f1a  source/getopt.c
  28.      ca1ada43f73cff4466adde1e88a8cf60  source/md5.c
  29.      4a6dafa2f6282430e65d4728a1303a53  source/md5sum.c
  30.  
  31.     So, what is this useful for? Say, you're releasing a software
  32. package including sources to the public and want to make shure, nobody
  33. modifies the program (for example: add backdoors) and redistributes the
  34. modified version. (2) You could include the digest-file with a checksum
  35. of every single file in release archive and everybody could easily
  36. check the validity of the files.
  37.  
  38.     ---------- Footnotes ----------
  39.  
  40.     (1)  Placed in the public domain by RSA Data Security, Inc.
  41.  
  42.     (2)  Do not laugh, this already happened with BBS packages or
  43. common utilities. Once, even a virus was added to a utility!
  44.  
  45. How to invoke MD5SUM
  46. ====================
  47.  
  48.     If you need a short overview of the options MD5SUM provides, just
  49. call ```MD5SUM -h''' to get this help output:
  50.  
  51.      usage: md5sum [-bv] [-c [file]] | [file...]
  52.      Generates or checks MD5 Message Digests
  53.          -c  check message digests (default is generate)
  54.          -v  verbose, print file names when checking
  55.          -b  read files in binary mode
  56.      The input for -c should be the list of message digests and file names
  57.      that is printed on stdout by this program when it generates digests.
  58.  
  59.     If you want to generate checksums, just call MD5SUM with the paths
  60. of the files you want to include in the digest file. (1) The output is
  61. printed to standard output and may be redirected using the `>' sign.
  62. For example:
  63.  
  64.      MD5SUM >ram:test.md5 file1 file2 path1/file3 path2/file4
  65.  
  66.     MD5SUM defaults to text mode and does not care about the end-of-line
  67. code, which may vary between platforms (like Amiga <-> MS-DOS).
  68.  
  69.     If you want to generate exact checksums for binaries, you'll have to
  70. set the `-b' flag. Files with a binary checksum are prefaced with a `*'
  71. in the digestfile:
  72.  
  73.      ca1ada43f73cff4466adde1e88a8cf60  source/md5.c
  74.      34d0ee57bd7fa4ab699c1c3c0a522eb7 *md5sum
  75.      4a6dafa2f6282430e65d4728a1303a53  source/md5sum.c
  76.  
  77.     Checking the validity of the files is quite easy, too. Just call
  78. MD5SUM with the `-c' option and the name of the digest file.  (2) Say,
  79. we'd have saved the above example under `test.md5', the correct
  80. commandline would be:
  81.  
  82.      MD5SUM -c test.md5
  83.  
  84.     If no filename is specified, MD5SUM tries to read the digest file
  85. from standard input
  86.  
  87.      MD5SUM -c <test.md5
  88.  
  89. Due to this, you can pipe data to (or from) MD5SUM.
  90.  
  91.     MD5SUM silently reads each file and checks the MD5 fingerprint. It
  92. only complains about files that fail the test. Example:
  93.  
  94.      md5sum: MD5 check failed for 'md5.c'
  95.  
  96.     If you specify the `-v' flag, MD5SUM prints the filename of the
  97. file it is currently working on. Example:
  98.  
  99.      getopt.c       OK
  100.      md5.c          FAILED
  101.      md5sum.c       OK
  102.      md5sum: 1 of 3 file(s) failed MD5 check
  103.  
  104.     MD5SUM is smart enough to use only the lines of a textfile, really
  105. containing MD5 fingerprints. For example, the following digest file
  106. would be interpreted without any problems:
  107.  
  108.      -----------------------------------------------------------------
  109.      This is a digest file for the MD5SUM utility. To check the
  110.      validity of all files in the distribution, please unpack the
  111.      archive, go into the "ProjectName/" directory and start "MD5SUM
  112.      -cv `projname.md5'".
  113.      
  114.              Sources:
  115.      
  116.      107788ec46ef6ab9dbb190215f5b6f1a  getopt.c
  117.      3e51da0ccff62cf16cf60df6d3afdeb3  md5.c
  118.      4a6dafa2f6282430e65d4728a1303a53  md5sum.c
  119.      
  120.              Binaries:
  121.      
  122.      34d0ee57bd7fa4ab699c1c3c0a522eb7 *md5sum
  123.      
  124.      END OF FILE
  125.      -----------------------------------------------------------------
  126.  
  127.     Last, but not least, I'd like to mention, that MD5SUM is pure and
  128. may be made resident.
  129.  
  130.     ---------- Footnotes ----------
  131.  
  132.     (1)  Currently, MD5SUM does not support pattern matching. You'll
  133. need a shell that does this for you or you'll have to generate a script
  134. with "List" and the `LFORMAT' keyword.
  135.  
  136.     (2)  A common problem is, that the user starts MD5SUM in another
  137. current directory, than the file has been generated in and MD5SUM can't
  138. find the file under the given path. Watch this, please.
  139.  
  140. One word about security
  141. =======================
  142.  
  143.     Mainly, there're two questions concerning the "real" security of
  144. MD5SUM. How secure is the MD5 algorithm? and How can I protect my
  145. digest file from beeing modified?
  146.  
  147. The first questions is answered by Ronald Rivest, MD5's designer:
  148.  
  149.      "It is conjectured that the difficulty of coming up with two
  150.      messages having the same message digest is on the order of 2^64
  151.      operations, and that the difficulty of coming up with any message
  152.      having a given message digest is on the order of 2^128 operations.
  153.      The MD5 algorithm has been carefully scrutinized for weaknesses.
  154.      It is, however, a relatively new algorithm and further security
  155.      analysis is of course justified, as is the case with any new
  156.      proposal of this sort. The level of security provided by MD5
  157.      should be sufficient for implementing very high security hybrid
  158.      digital signature schemes based on MD5 and the RSA public-key
  159.      cryptosystem."
  160.  
  161.     The second problem is more important. Say, you have generated a
  162. digest file for every single file in your distribution and released it.
  163. But what happens if somebody modifies the source and just generates a
  164. new digest file for the new files??
  165.  
  166.     To avoid this, you can, for example, post the digestfile in an
  167. appropiate newsgroup. This is nice, but far from secure! A much better
  168. way is to append your PGP (see later in text for more information on
  169. PGP) public key to the digest file and sign the complete file.
  170.  
  171.     Then one could do the following to validate the package with 100%
  172. security:
  173.  
  174.    - add your public key to the keyring
  175.  
  176.    - check the validity of the signed digest file
  177.  
  178.    - check all files using MD5SUM
  179.  
  180.     For those who do not know, Pretty Good(tm) Privacy (PGP), is a high
  181. security cryptographic software application for MSDOS, Unix, VAX/VMS,
  182. Amiga and other computers. PGP allows people to exchange files or
  183. messages with privacy, authentication, and convenience. Privacy means
  184. that only those intended to receive a message can read it.
  185. Authentication means that messages that appear to be from a particular
  186. person can only have originated from that person. Convenience means
  187. that privacy and authentication are provided without the hassles of
  188. managing keys associated with conventional cryptographic software. No
  189. secure channels are needed to exchange keys between users, which makes
  190. PGP much easier to use. This is because PGP is based on a powerful new
  191. technology called "public key" cryptography.
  192.  
  193. The latest version of PGP should be available on these FTP servers:
  194.  
  195.      Finland:    nic.funet.fi  (128.214.6.100)
  196.                  Directory: /pub/unix/security/crypt/
  197.      
  198.      Italy:      ghost.dsi.unimi.it  (149.132.2.1)
  199.                  Directory: /pub/security/
  200.      
  201.      USA:        pencil.cs.missouri.edu  (128.206.100.207)
  202.                  Directory: /pub/crypt/
  203.      
  204.      For those lacking FTP connectivity to the net, nic.funet.fi also
  205.      offers the files via email.
  206.  
  207.